home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-14 | 503 b | 32 lines | [TEXT/KAHL] |
- /* example from ASU p.124 */
- a = [a];
- b = [b];
- c = [c];
- d = [d];
- r = (a|b|c|d)* a b b;
- %{
- #include <stdlib.h>
- #ifdef THINK_C
- #include <CONSOLE.H>
- #endif
- #define _lmovb _lmovb_debug
- extern SHORTINT _lmovb_debug();
-
- main()
- {
- int token_number;
- #ifdef THINK_C
- cecho2file("asu124.log",0, stdout);
- #endif
- while(token_number = yylex())
- printf("\nyylex returns %d\n", token_number);
- printf("\nyylex returns NULL\n");
- }
- %}
- %%
- r {
- printf((char *)"\nrecognized r\n");
- return 1;
- }
- %%
- void yyinit() {}